import request from '@/utils/request'
// 获取所以角色
export const getAllUser = params => request({
  url: '/sys/role',
  params
})
export const getCompany = id => request({
  url: `/company/${id}`
})
// 删除角色
export const delRole = id => request({
  url: `/sys/role/${id}`,
  method: 'DELETE'
})

// 更新角色
export const updataRole = data => request({
  url: `/sys/role/${data.id}`,
  method: 'PUT',
  data
})

// 根据id获取角色
export const getRoleById = id => request({
  url: `/sys/role/${id}`
})
// 新增角色
export const addRole = data => request({
  url: '/sys/role',
  method: 'POST',
  data
})
// 给角色分配权限
export const allotPerApi = data => request({
  url: '/sys/role/assignPrem',
  method: 'PUT',
  data
})
